<!DOCTYPE HTML>
<html>
<head>
<title>FileCreateDir | AutoHotkey</title>
<meta name="description" content="The FileCreateDir command creates a folder." />
<meta name="ahk:equiv-v2" content="commands/DirCreate.htm" />
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link href="../static/theme.css" rel="stylesheet" type="text/css" />
<script src="../static/content.js" type="text/javascript"></script>
<script type="text/javascript">$(function(){0<=window.navigator.userAgent.toLowerCase().indexOf("ucbrowser")&&CaoNiMaDeUc()})</script>
</head>
<body>

<h1>FileCreateDir</h1>

<p>创建文件夹.</p>

<pre class="Syntax"><span class="func">FileCreateDir</span>, DirName</pre>
<h2 id="Parameters">参数</h2>
<dl>

  <dt>DirName</dt>
  <dd><p>要创建的目录名, 如果未指定绝对路径, 则假定在 <a href="../Variables.htm#WorkingDir">%A_WorkingDir%</a> 中.</p></dd>

</dl>
<h2 id="Error_Handling">错误处理</h2>
<p><span class="ver">[v1.1.04+]</span>: 此命令失败时会抛出异常. 想了解更多信息, 请参阅<a href="Catch.htm#RuntimeErrors">运行时错误</a>.</p>
<p>如果遇到问题则 <a href="../misc/ErrorLevel.htm">ErrorLevel</a> 被置为 1, 否则为 0.</p>
<p><a href="../Variables.htm#LastError">A_LastError</a> 被设置为操作系统 GetLastError() 函数返回的结果.</p>
<h2 id="Remarks">备注</h2>
如果 <em>DirName</em> 中给出的父目录还不存在, 则此命令也会创建它们.
<h2 id="Related">相关</h2>
<p><a href="FileRemoveDir.htm">FileRemoveDir</a></p>
<h2 id="Examples">示例</h2>
<div class="ex" id="ExBasic">
<p><a class="ex_number" href="#ExBasic"></a> 创建一个新的目录, 必要时包括其父目录.</p>
<pre>FileCreateDir, C:\Test1\My Images\Folder2</pre>
</div>

</body>
</html>